<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>叠加3D楼块图层</title>
<link rel="stylesheet" type="text/css" href="http://api.amap.com/Public/css/demo.Default.css" />
<script language="javascript" src="http://webapi.amap.com/maps?v=1.2&key=3fc57052a64e09c143a7050a43598041"></script>
<script language="javascript">
var mapObj;
//初始化地图对象，加载地图
function mapInit(){
    mapObj = new AMap.Map("iCenter",{center:new AMap.LngLat(121.498586,31.239637),
        level:17}); 
    addBuildings();
}
function addBuildings(){
        if (typeof(Worker) !== "undefined") {
            var buildings = new AMap.Buildings(); //实例化3D楼块图层
            buildings.setMap(mapObj);//在map中添加3D楼块图层
        }else{
            document.getElementById("info").innerHTML="对不起，运行该示例需要浏览器支持HTML5！";
        }
        }
</script>
</head>
<body onLoad="mapInit()">
    <div id="iCenter"></div>
    <div id="info" style="padding:2px 0px 0px 5px;font-size:12px; color:red;height:20px"></div>
</body>
</html>